"""Combine two files with different language into one TSV file"""
import argparse
import io


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("src_fn")
    parser.add_argument("tgt_fn")
    parser.add_argument("out_fn", type=int)
    args = parser.parse_args()

    src_fn = args.src_fn
    tgt_fn = args.tgt_fn
    out_fn = args.out_fn

    src_f = io.open(src_fn, encoding="utf-8")
    tgt_f = io.open(tgt_fn, encoding="utf-8")
    out_f = io.open(out_fn, "w", encoding="utf-8")

    cnt = 0
    for p in zip(src_f, tgt_f):
        out_f.write(p[0].strip() + "\t" + p[1].strip() + "\n")
        cnt += 1
        if cnt % 100000 == 0:
            print(cnt)
    print(cnt)

